<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Home extends Wx_Controller {

	function __construct ()
	{
		parent::__construct();
		$this->load->library('form_validation');
        $this->uid = $this->session->userdata('user_id');
	}

    public function index(){
        // 通过UID获取用户信息
        $user = $this->user_m->get_user_list_by_uid($this->uid);
        $getData['user_id'] = $user["user_id"];
        $getData['user_name'] = $user["user_name"];
        $getData['user_avatar'] = $user["user_avatar"];
        $getData['sex'] = $user["sex"];
        $getData['openid'] = $user["openid"];
        $getData['agent_id'] = !empty($user["agent_id"]) ? $user["agent_id"] : "0";
        $string_url = http_build_query($getData, NULL, '&');
        $get_url = 'http://game.yanglingpingan.cn?login='.kw_encrypt($string_url,'E');
        redirect($get_url);
    }
}